package com.androideasy.permissions

import androidx.fragment.app.FragmentActivity
import java.util.ArrayList

interface PermissionInterceptor {

    fun requestPermissions(
        activity: FragmentActivity,
        callback: PermissionCallback,
        allPermissions: List<String>
    ) {
        PermissionFragment.beginRequest(activity, ArrayList (allPermissions), this, callback)
    }


    fun grantedPermissions(
        activity: FragmentActivity, allPermissions: List<String>,
        grantedPermissions: List<String>, all: Boolean,
        callback: PermissionCallback
    ) {
        if (callback == null) {
            return
        }
        callback.onGranted(grantedPermissions, all)
    }

    fun deniedPermissions(
        activity: FragmentActivity, allPermissions: List<String>,
        deniedPermissions: List<String>, never: Boolean,
        callback: PermissionCallback
    ) {
        if (callback == null) {
            return
        }
        callback.onDenied(deniedPermissions, never)
    }
}